import { request } from '@/utils'

interface TaskData {
  [key: string]: any
}

interface TaskParams {
  [key: string]: any
}

export const inspectionTask = {
  create(data: TaskData) {
    return request({
      url: '/robot-inspection-task/v1/create',
      method: 'post',
      data
    })
  },
  read(params: TaskParams) {
    return request({
      url: '/robot-inspection-task/v1/list',
      method: 'get',
      params
    })
  },
  update(data: TaskData) {
    return request({
      url: '/robot-inspection-task/v1/update',
      method: 'put',
      data
    })
  },
  delete(id: string | number) {
    return request({
      url: '/robot-inspection-task/v1/delete/' + id,
      method: 'delete'
    })
  },
  activation(id: string | number) {
    return request({
      url: '/robot-inspection-task/activation/' + id,
      method: 'get'
    })
  },
  control(data: TaskData) {
    return request({
      url: '/robot-disinfect-task/control',
      method: 'post',
      data
    })
  }
}
